Skip to content

cv2_utils 中文路径兼容 + 测试方法论 + harness 文档整理 - #2461

Merged
DoctorReid merged 13 commits into
mainfrom
feat/fixture-op-testing
Jul 8, 2026
Merged

cv2_utils 中文路径兼容 + 测试方法论 + harness 文档整理#2461
DoctorReid merged 13 commits into
mainfrom
feat/fixture-op-testing

Conversation

@DoctorReid

@DoctorReid DoctorReid commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

改动

fix(cv2_utils):中文路径兼容

  • read_image / save_image 兼容非 ASCII(中文)路径(cv2.imreadnp.fromfile+imdecode;cv2.imwriteimencode+tofile)。

docs:测试方法论 + 截图存档

  • 新建 docs/develop/testing/(README + fixture_controller):测试基建 / FixtureController 多帧流程测试 / 提交坑 / 测试代码规范。
  • 新建 docs/develop/zzz/screenshot_archive.md:画面截图存档(webp q90 / 中文路径 / 加图流程)。
  • screen-onboarding skill 补归档步骤。

docs:harness 文档整理

  • 入口链路:.github/README 参与开发指向 RECRUITING+quickstart;RECRUITING 快速开始 delegate quickstart。
  • skills 单源:清单以 skills/ 目录为源,去掉 quickstart/ai_coding/harness 硬编码罗列(曾漏 screen-onboarding)。
  • 相关仓库:新建 setup/repositories.md(测试仓 / yolo / 数据集 / 官网 blog);quickstart 加 fork 区分;AGENTS 加指针。
  • 开发流程:新建 development_workflow.md(游戏自动化功能 + OpenAndEnterGame 实例 + 配套判据 + 跨仓 PR 顺序);AGENTS 加 always-on 骨架;skill 标题「画面入职」→「画面建档」。

测试

测试在独立仓,测试仓 PR #10:OneDragon-Anything/zzz-od-test#10 (同分支名 feat/fixture-op-testing,CI 按分支名 clone 测试仓)。

Summary by CodeRabbit

  • 新功能
    • 新增端到端开发流程与测试方法论入口,补充多帧流程测试(FixtureController)指引与截图存档规范。
    • 完善画面建档/归档流程:新增“归档代表截图”规则,并统一测试仓内落盘要求。
    • 新增 PNG→WebP 转换脚本,支持中文路径安全读写。
  • Bug 修复
    • 优化图片读写兼容非 ASCII 路径,解码/保存失败处理更稳健,WebP 输出更一致。
  • 文档
    • 更新协作者指引、快速开始、多仓协作与测试/画面规范;补充 PR 收尾判据与评审处理约束。

DoctorReid and others added 3 commits July 8, 2026 15:32
cv2.imread/imwrite 在 Windows 走 C stdlib,中文路径会失败。改用 np.fromfile+cv2.imdecode(读)/ cv2.imencode+ndarray.tofile(写),走 OS API 认中文路径。向后兼容(ASCII 照常);save_image 写盘失败静默(同原 imwrite best-effort);webp 维持 q=100(注:q100 实为高质量有损,非无损;真无损要 q101——既有行为,本次不改)。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
- docs/develop/testing/ (新): README (怎么跑 + test_context 基建 + 写法 + 提交坑 + 代码规范迁移自 agent_guidelines) + fixture_controller.md (FixtureController 流程测试详细)
- docs/develop/zzz/screenshot_archive.md (新): 截图存档(游戏知识库生态 + webp q90 格式 + 加图流程 + 裁模板用原图)
- docs/develop/README.md: 索引加测试/截图 + §1.3 指针
- AGENTS.md: 测试方法论指针 + 修正 line 17 stale pointer
- agent_guidelines.md: §测试代码规范迁移到 testing/ §5(不留指针,agent_guidelines 后续废弃)
- docs/game/README.md: §4 截图基线 加反向指针
- skills/zzz-od-dev-screen-onboarding: step 6 归档代表截图 + step 5 裁模板用原图非 webp

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
- 入口链路:.github/README 参与开发指向 RECRUITING+quickstart;RECRUITING 快速开始 delegate quickstart
- skills 单源:清单以 skills/ 目录为源,去 quickstart/ai_coding/harness 的硬编码罗列(曾漏 screen-onboarding)
- 相关仓库:新建 setup/repositories.md(测试仓/yolo/数据集/官网 blog);quickstart 加 fork 区分;AGENTS 加指针
- 开发流程:新建 development_workflow.md(游戏自动化功能+OpenAndEnterGame 实例+配套判据+跨仓PR顺序);AGENTS 加 always-on 骨架;screen-onboarding skill 标题 画面入职→画面建档

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

本 PR 更新了贡献者与开发文档入口、测试与流程说明、截图存档规范和技能文档,并将图像读写实现改为兼容非 ASCII 路径。

Changes

贡献者文档与开发流程重构

Layer / File(s) Summary
入口引导与测试约束
.github/README.md, AGENTS.md, docs/develop/RECRUITING.md
入口说明改为指向《贡献者招募》《快速开始》和新的端到端开发流程;同时补充测试仓使用约束与 AI 检索测试目录的说明。
仓库获取与技能索引
docs/develop/setup/quickstart.md, docs/develop/setup/repositories.md, docs/develop/harness/README.md, docs/develop/setup/ai_coding.md
快速开始按项目成员与外部贡献者区分仓库获取方式,补充相关仓库布局说明,并将 skills/ 清单说明改为指向目录动态查看。
端到端开发流程文档
docs/develop/development_workflow.md, docs/develop/README.md
新增开发流程文档,定义画面建档、开发、测试、跨仓 PR 与配套产出步骤,并更新开发文档索引与测试入口引用。
测试基建与规范文档
docs/develop/testing/README.md, docs/develop/testing/fixture_controller.md, docs/develop/spec/agent_guidelines.md
新增测试仓运行方式、MockController/test_context、FixtureController 流程测试与测试代码规范文档;同时移除旧测试规范章节并新增截图区域规范。
画面建档与截图存档
skills/zzz-od-dev-screen-onboarding/SKILL.md, docs/develop/zzz/screenshot_archive.md, docs/game/README.md, skills/zzz-od-dev-screen-onboarding/convert_to_webp.py, skills/zzz-od-dev-pr-finishing/SKILL.md
画面建档技能新增代表截图归档步骤,并补充截图存档、转换脚本、PR 收尾协同与游戏文档条目调整。

图像读写兼容非ASCII路径

Layer / File(s) Summary
图像读写实现替换
src/one_dragon/utils/cv2_utils.py
read_image 改为 np.fromfile + cv2.imdecodesave_image 改为 cv2.imencode + ndarray.tofile,并保留 webp 参数与失败处理。

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: Usagi-wusaqi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次 PR 的三大主线:cv2_utils 中文路径兼容、测试方法论补充和 harness 文档整理。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fixture-op-testing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/develop/setup/quickstart.md (1)

62-64: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

修正这 4 个相对链接。

setup/quickstart.md../../AGENTS.mdREADME.mdspec/agent_guidelines.md 在当前文件位置下都会解析到错误路径;前者会落到不存在的 setup/setup/quickstart.mdAGENTS.md 少一层 ..,后两个也少一层父目录。请分别改成 ./quickstart.md../../../AGENTS.md../README.md../spec/agent_guidelines.md,或者把自引用改成纯文本/锚点。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/develop/setup/quickstart.md` around lines 62 - 64, The relative links in
quickstart.md are resolving from the wrong base path, so update the
self-reference and sibling/document links in this section using the current
file’s location and the unique anchors around “src/ 进入模块搜索路径”; specifically, fix
the quickstart self-link, the AGENTS.md link, README.md link, and
spec/agent_guidelines.md link so they point to the intended targets from this
document (or replace the self-reference with plain text/anchor text if
appropriate).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/develop/setup/quickstart.md`:
- Around line 90-94: quickstart.md 里的克隆示例把组织成员和外部贡献者两种互斥的 clone
方式放在同一个代码块里,导致整块复制会误执行两条命令;请在相关的克隆示例处将这两种方式拆成两个独立代码块,或把其中一条改成纯说明文本,避免用户直接复制时同时执行。注意定位到该文档中包含
git clone 的示例段落即可。

In `@skills/zzz-od-dev-screen-onboarding/SKILL.md`:
- Line 3: `description` 目前同时包含了触发条件和执行步骤,职责过宽。请在 `SKILL.md` 中把 `description`
收窄为只描述“何时使用”这类触发场景,去掉“分析/建档/建模/归档”等动作说明;具体流程应移到正文部分,保持与 `SKILL.md` 和
`skills/zzz-od-dev-skill-guide/SKILL.md` 的约定一致。

---

Outside diff comments:
In `@docs/develop/setup/quickstart.md`:
- Around line 62-64: The relative links in quickstart.md are resolving from the
wrong base path, so update the self-reference and sibling/document links in this
section using the current file’s location and the unique anchors around “src/
进入模块搜索路径”; specifically, fix the quickstart self-link, the AGENTS.md link,
README.md link, and spec/agent_guidelines.md link so they point to the intended
targets from this document (or replace the self-reference with plain text/anchor
text if appropriate).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9ee88ce1-9d1a-4c19-80a6-8ef7a6cc1600

📥 Commits

Reviewing files that changed from the base of the PR and between 6621f95 and 6427c81.

📒 Files selected for processing (16)
  • .github/README.md
  • AGENTS.md
  • docs/develop/README.md
  • docs/develop/RECRUITING.md
  • docs/develop/development_workflow.md
  • docs/develop/harness/README.md
  • docs/develop/setup/ai_coding.md
  • docs/develop/setup/quickstart.md
  • docs/develop/setup/repositories.md
  • docs/develop/spec/agent_guidelines.md
  • docs/develop/testing/README.md
  • docs/develop/testing/fixture_controller.md
  • docs/develop/zzz/screenshot_archive.md
  • docs/game/README.md
  • skills/zzz-od-dev-screen-onboarding/SKILL.md
  • src/one_dragon/utils/cv2_utils.py
💤 Files with no reviewable changes (1)
  • docs/develop/spec/agent_guidelines.md

Comment thread docs/develop/setup/quickstart.md Outdated
Comment thread skills/zzz-od-dev-screen-onboarding/SKILL.md Outdated
DoctorReid and others added 2 commits July 8, 2026 16:02
… Application + gloss 对齐 op_name + 弱化 OpenGame 措辞

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
…g description 收窄(只留触发)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@DoctorReid

Copy link
Copy Markdown
Collaborator Author

@coderabbitai 3 条 comment 处理:

  1. quickstart.md 链接(outside diff)— 误判,不修:所指链接(setup/quickstart.md../../AGENTS.mdREADME.mdspec/agent_guidelines.md)实际在 RECRUITING.md(docs/develop/ 下),../../AGENTS.md 只需 2 层到根、全部正确;quickstart.md:62-64### 4. 标题、无链接。定位把 RECRUITING 的链接当成了 quickstart(docs/develop/setup/,需 3 层),少算一层。

  2. quickstart §② 两 clone 同块 — 有效,已修:拆成「组织成员 / 外部贡献者」两个独立代码块,避免整块复制连续执行两条互斥 clone。

  3. SKILL description 收窄 — 有效,已修(违反 skill-guide §2「description 只写何时用」):去掉「screen_info(建档+建模)/ 归档」(做什么),只留触发条件「拿到截图、需要分析并纳入知识库时用」。

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
sed -n '1,80p' docs/develop/setup/quickstart.md
echo "-----RECRUITING-----"
sed -n '1,60p' docs/develop/RECRUITING.md

Length of output: 4170


@DoctorReid 谢谢确认,逐条回应:

  1. quickstart.md 链接 — 认可你的更正:确认是我把 RECRUITING.md 里的链接错误关联到了 quickstart.md 的路径深度上,导致相对路径层级计算错误(少算了一层)。quickstart.md:62-64 确实只是无链接的标题文本。撤回该条评论。

  2. quickstart §② 拆分 clone 代码块 — 已确认修复:看到 docs/develop/setup/quickstart.md 中「组织/项目成员」和「外部贡献者」现在是两个独立的 PowerShell 代码块,避免了整块复制时连续执行两条互斥的 git clone 命令。

  3. SKILL description 收窄 — 认可你的处理方式:按 skill-guide §2 的要求,description 只保留触发条件("拿到截图、需要分析并纳入知识库时用"),去掉了"做什么"的描述,这个改动是合理的。

DoctorReid and others added 6 commits July 8, 2026 16:37
…e 图压缩原则

- skills/zzz-od-dev-screen-onboarding/convert_to_webp.py: PNG→webp q90(单张/目录,中文路径安全)
- onboard §6 归档改用脚本
- testing/README §6: 测试 fixture 整屏图尽量 q90(满足测试为准),OCR/精度敏感保留 PNG

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
…录,保留原 png)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
…6 同步

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
- pr-finishing done criteria 加「关联 PR 也都 done」+ §6 关联 PR 协同(一起收尾 / 合并顺序测试仓先 / 都 done 才合)
- development_workflow §4 交叉引用 pr-finishing §6(合并顺序)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/zzz-od-dev-screen-onboarding/SKILL.md`:
- Around line 57-60: The fenced code block in the onboarding docs is missing a
language identifier, triggering markdownlint MD040. Update the example under the
convert_to_webp.py usage in SKILL.md to declare the fence as shell so the
snippet is recognized as a shell command; keep the existing command content
unchanged and ensure the fix is applied to the specific fenced block near the
convert_to_webp.py example.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bcf4c50a-e937-4b7c-8c07-b20ca4e91660

📥 Commits

Reviewing files that changed from the base of the PR and between ef6931c and c8beedc.

📒 Files selected for processing (5)
  • docs/develop/development_workflow.md
  • docs/develop/testing/README.md
  • skills/zzz-od-dev-pr-finishing/SKILL.md
  • skills/zzz-od-dev-screen-onboarding/SKILL.md
  • skills/zzz-od-dev-screen-onboarding/convert_to_webp.py
✅ Files skipped from review due to trivial changes (2)
  • docs/develop/testing/README.md
  • docs/develop/development_workflow.md

Comment thread skills/zzz-od-dev-screen-onboarding/SKILL.md
…abbit outside-diff 平台限制说明

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@DoctorReid

Copy link
Copy Markdown
Collaborator Author

@coderabbitai SKILL.md §6 convert_to_webp.py 的 code fence 已加 shell 语言标识(MD040 fixed)。

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
sed -n '1,60p' skills/zzz-od-dev-pr-finishing/SKILL.md | grep -n '```' 
grep -n '```' skills/zzz-od-dev-pr-finishing/SKILL.md

Length of output: 352


🏁 Script executed:

#!/bin/bash
sed -n '40,55p' skills/zzz-od-dev-pr-finishing/SKILL.md

Length of output: 1034


🏁 Script executed:

#!/bin/bash
grep -n '```' skills/zzz-od-dev-screen-onboarding/SKILL.md
sed -n '1,80p' skills/zzz-od-dev-screen-onboarding/SKILL.md

Length of output: 4020


Confirmed — the code fence for convert_to_webp.py usage in skills/zzz-od-dev-screen-onboarding/SKILL.md §6 now has the shell language identifier (Line 58), fixing the MD040 lint warning.

@DoctorReid Confirmed, thanks for fixing it.

…制)+ rate limit(per-developer 配额)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@DoctorReid

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@DoctorReid

Copy link
Copy Markdown
Collaborator Author

@coderabbitai resume

@DoctorReid

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@DoctorReid
DoctorReid merged commit c1ade67 into main Jul 8, 2026
8 checks passed
@DoctorReid
DoctorReid deleted the feat/fixture-op-testing branch July 8, 2026 11:09
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant